using System.Collections.Generic;

namespace Core.GameObjects.Jobs
{
    public enum JobType
    {
        Delivery,
        Item,
        Kill,
        Rescue
    }

    public class FactionAdjust
    {
        public int ID;
        public int Value;
    }

    public class Job
    {
        private int _id;
        private string _name;
        private string _description;
        private JobType _type;
        private JobRewardType _rewardType;
        private int _rewardItemID;
        private int _rewardMoneyAmount;
        private List<int> _requiredClasses;
        private int _requiredLevel;
        private bool _isMultipleAllowed;

        // 0 means no limit
        private long _timeBetweenJobs;

        // total time in which Job must be completed, 0 for none
        private long _timeLimit;

        // is the reward known by the player when accepting the Job
        private bool _isRewardShown;

        private List<FactionAdjust> _factions;

        private List<JobStep> _steps = new List<JobStep>();

        private string _fileName;

        public Job()
        {

        }

        public int ID
        {
            get { return _id; }
            set { if (value > 0) _id = value; }
        }

        public string Name
        {
            get { return _name; }
            set { if (!string.IsNullOrEmpty(value)) _name = value; }
        }

        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }

        public JobType Type
        {
            get { return _type; }
            set { _type = value; }
        }

        public JobRewardType RewardType
        {
            get { return _rewardType; }
            set { _rewardType = value; }
        }

        public int RewardItemID
        {
            get { return _rewardItemID; }
            set { _rewardItemID = value; }
        }

        public List<int> RequiredClasses
        {
            get { return _requiredClasses; }
            set { _requiredClasses = value; }
        }

        public int RequiredLevel
        {
            get { return _requiredLevel; }
            set { if (value > 0) _requiredLevel = value; }
        }

        public bool MultipleAllowed
        {
            get { return _isMultipleAllowed; }
            set { _isMultipleAllowed = value; }
        }

        public long TimeBetweenJobs
        {
            get { return _timeBetweenJobs; }
            set { if (value > -1) _timeBetweenJobs = value; }
        }

        public long TimeLimit
        {
            get { return _timeLimit; }
            set { if (value > -1) _timeLimit = value; }
        }

        public bool RewardShown
        {
            get { return _isRewardShown; }
            set { _isRewardShown = value; }
        }

        public List<FactionAdjust> Factions
        {
            get { return _factions; }
            set { _factions = value; }
        }

        public List<JobStep> Steps
        {
            get { return _steps; }
            set { _steps = value; }
        }

        public string FileName
        {
            get { return _fileName; }
            set { _fileName = value; }
        }
    }
}
